/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef UPDATE_LITE_MQTT_OTA_H
#define UPDATE_LITE_MQTT_OTA_H

#include "update_lite_defines.h"



uint32_t InitMQTTConnect(UpdateLiteCallback callback);
uint32_t GetFirmwareInfo(struct UpdateLiteInfo *info, char * url, downloadCallback callback);


typedef enum enum_MQTT_CALLBACK_SETTING
{
    EN_MQTT_CALLBACK_CONNECT_SUCCESS = 11,
    EN_MQTT_CALLBACK_CONNECT_FAILURE = 12,  //注意 ：如果需要接管失败的回调，则内部不再重新连接
    EN_MQTT_CALLBACK_DISCONNECT_SUCCESS = 13,
    EN_MQTT_CALLBACK_DISCONNECT_FAILURE = 14,  
    EN_MQTT_CALLBACK_CONNECTION_LOST = 15,  //注意 ：如果需要接管失败的回调，则内部不再重新连接

    EN_MQTT_CALLBACK_PUBLISH_SUCCESS = 21,
    EN_MQTT_CALLBACK_PUBLISH_FAILURE = 22,

    EN_MQTT_CALLBACK_SUBSCRIBE_SUCCESS = 31,
    EN_MQTT_CALLBACK_SUBSCRIBE_FAILURE = 32,

    EN_MQTT_CALLBACK_MESSAGE_ARRIVED = 41,

}EN_MQTT_CALLBACK_SETTING;

/*
typedef struct UpdateLiteService {
    INHERIT_SERVICE;
    Identity identity;
} UpdateLiteService;

typedef struct UpdateLiteFeatureApi {
    INHERIT_SERVER_IPROXY;
    int32_t (*UpdateLiteXxxApi)(IUnknown *iUnknown, IpcIo *req, IpcIo *reply);
} UpdateLiteFeatureApi;

typedef struct UpdateLiteFeature {
    INHERIT_FEATURE;
    INHERIT_IUNKNOWNENTRY(UpdateLiteFeatureApi);
    Identity identity;
    Service *parent;
} UpdateLiteFeature;

void UpdateLiteServiceInit(void);
void UpdateLiteFeatureInit(void);
*/
#endif // UPDATE_LITE_MQTT_OTA_H
